#ifndef otkxstring_h_
#define otkxstring_h_
#include <string>
#define G_ERROR_SUCCEED 0       //succeed
#define G_ERROR_INVALIDPARAM -1 //invalid param
#define G_ERROR_INTERNAL -2     //internal call error
#define G_ERROR_NOBUF -3        //new buffer failed
namespace gconvert
{
    // ANSI->Unicode
    int ansi2uni(const std::string &ansi, std::wstring &uni);
    // Unicode->ANSI
    int uni2ansi(const std::wstring &uni, std::string &ansi);
    // UTF8->Unicode
    int utf82uni(const std::string &utf8, std::wstring &uni);
    // Unicode->UTF8
    int uni2utf8(const std::wstring &uni, std::string &utf8);
    // ANSI->UTF8
    int ansi2utf8(const std::string &ansi, std::string &utf8);
    // UTF8->ANSI
    int utf82ansi(const std::string &utf8, std::string &ansi);
    // string->int
    int str2int(const std::string istr);
    // GBK->UTF8
    std::string GBKToUTF8(const char *strGBK);
    // UTF8->GBK
    std::string UTF8ToGBK(const char *strUTF8);
} // namespace gconvert

#endif
